<html>
  <head>
    <title>创建任务</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<link href="../../css/general1.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../script/hiawardbpm.js"></script>
    <script type="text/javascript" src="../../script/prototype.js"></script>
    <script type="text/javascript">
      function subForm(){
       var webData=buildWebData();  
       var xmlMsg=new WebProcessMsg();
       xmlMsg.setCommand(9);
       xmlMsg.setAction("/CreateVoucherAction");
       xmlMsg.setProcessName("WebProcessVchzms");
       xmlMsg.setWebData(webData);
       xmlMsg.buildXML();
       var url="/vchzms-hiaward/ProcessAjaxHandler";
       alert(xmlMsg.getXmlDocument().xml);
       new Ajax.Request(url,{
          method:'post',
          postBody:xmlMsg.getXmlDocument().xml,
          contentType:'application/x-www-form-urlencoded',
          encoding:'UTF-8',
          onComplete:function(transport){
	          try{
		          if(200==transport.status){
		               alert('创建成功');
		              }
		          if(400==transport.status){
		               alert('创建失败');
		              }
	          }catch(err){
	              alert('创建失败');
	          }
          }
       });
      }
    function buildWebData(){
      var webData=new WebData();
      return webData;
      }
    </script>
  </head>
  
  <body>
    点击创建任务<button onclick="subForm()">创建任务</button> <br>
  </body>
</html>
